package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.iotechn.unimall.data.domain.PurchaseOrderGoodsDO;
import com.iotechn.unimall.data.dto.purchase.PurchaseOrderGoodsDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 
 * 
 * @author hct
 * @email 77802226@qq.com
 * @date 2021-04-01 10:58:13
 */
public interface PurchaseOrderGoodsMapper extends BaseMapper<PurchaseOrderGoodsDO> {
    //查询待采购商品（包含当前库的商品数量）
    List<PurchaseOrderGoodsDTO> querySkusByWarehouseId(@Param("warehouseId") Long warehouseId, @Param("skuIds") List<Long> skuIds, @Param("offset") Integer offset, @Param("size") Integer size, @Param("search") String search);

    //统计
    Integer countSkusByWarehouseId(@Param("warehouseId") Long warehouseId, @Param("skuIds") List<Long> skuIds, @Param("search") String search);


    //统计采购商品
    List<PurchaseOrderGoodsDTO> querySkusByPara( @Param("pOrderId") Long pOrderId, @Param("offset") Integer offset, @Param("size") Integer size, @Param("search") String search);

    //根据采购单获取skuId的集合
    List<Long> getSkuIds( @Param("pOrderId") Long pOrderId);
}
